package com.donzell.test;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;

import com.donzell.test.other.JacksonTestBean;

/**
 * 演示是springboot的定时任务
 * @author Yooooo good gay
 *
 */
@Component
public class ScheduledTasks {
	private static final Logger logger = LoggerFactory.getLogger(ScheduledTasks.class);
	private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	
//	@Scheduled(fixedRate = 5000)
	public void ropertCurrentTime(){
		logger.info("当前时间是===>{}",DATE_FORMAT.format(new Date()));
//		rust();
	}
	
	public void rust(){
		RestTemplate restTemplate = new RestTemplate();
        JacksonTestBean quote = restTemplate.getForObject("http://dev.iwhere.com:8010/user-map-matching/mapMatching?timemills=1499049628205&lng=116.4082397671890021&lat=40.0197122160714969&mode=00&userId=1498808240425&", JacksonTestBean.class);
        logger.info(quote.toString());
	}
	
}
